/*
 * Clase encargada de gestionar la comunicacion con el dispositivo
 */
package co.springtree.spectrum.visa.api;

import co.springtree.spectrum.visa.api.Visa;
import co.springtree.spectrum.visa.api.VisaException;
import org.apache.log4j.BasicConfigurator;
import org.apache.log4j.Logger;
import visa32.Visa32Library;
import visatype.VisatypeLibrary;

/**
 *
 * @author Ricardo Carvajal Salamanca
 */
public class VisaCore {

    static private long visaResourceManagerHandle = 0;
    private long visaInstrumentHandle = 0;
    protected final int RESPONSE_BUFFER_DEFAULT_SIZE = 1024;
    public final long VISA_JAVA_ERROR = Visa32Library.VI_ERROR_SYSTEM_ERROR + 1;
    public boolean debugLog = false;
    
    static Logger logger = Logger.getLogger("VisaCore");
    public Visa visa;
    public void VisaCore(){
        BasicConfigurator.configure();
    }
    public void loadDevice() throws Exception {
        logger.info("Init Load device method");
        visa = new Visa();
        logger.info("Open Default Resource Manager.");
        long viStatus = visa.openDefaultResourceManager();
        if (viStatus != VisatypeLibrary.VI_SUCCESS) {
            throw new VisaException("Could not create session for resource manager.");
        }
        logger.info("Success.\r\n");
    }
    
    public void getResourceResponse(){
        
    }
}
